<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>动画</title>
    <style>
      .box {
        width: 200px;
        height: 200px;
        background-color: red;
        position: absolute;
        overflow: hidden;
        top: 0;
        left: 0;
        border-radius: 20%;
        animation: myanmation 2s linear infinite alternate;
        /*         名字   播放时间 播放函数  次数    来回     */
        /* animation: myanmation 2s linear forwards; */
        /*                                       停在最后 */
      }

      @keyframes myanmation {
        0% {
          width: 200px;
          height: 200px;
          background-color: red;
          top: 0;
          left: 0;
        }
        25% {
          background-color: #ff0;
          left: 500px;
        }
        50% {
          background-color: #00f;
          top: 500px;
          width: 100px;
          height: 100px;
        }
        100% {
          width: 100px;
          height: 500px;
          background-color: #0f0;
          right: 500px;
          width: 200px;
          height: 200px;
        }
      }
    </style>
  </head>
  <body>
    <div class="box">
      <img src="images/1.bmp" alt="" />
      <img src="images/3.bmp" alt="" />
    </div>
  </body>
</html>
